Number.prototype.getWeekName = function() {
    switch (parseInt(this)) {
    case 0:
        return "星期日";
    case 1:
        return "星期一";
    case 2:
        return "星期二";
    case 3:
        return "星期三";
    case 4:
        return "星期四";
    case 5:
        return "星期五";
    case 6:
        return "星期六";
    default:
        return "unknow";
    }
}
var x = setInterval(function() {
    var d = new Date();
    document.getElementById("a").innerText = d.getFullYear() + "-" + getZero((d.getMonth() + 1).toString()) + "-" + getZero(d.getDate().toString()) + "      " + getZero(d.getHours().toString()) + ":" + getZero(d.getMinutes().toString()) + ":" + getZero(d.getSeconds().toString()) + " " + d.getDay().getWeekName();
},
1000);
function getZero(str) {
    if (str < 10) {
        return "0" + "" + str;
    } else {
        return str;
    }
}